import VueRouter from 'vue-router'
//导入对应的路由组件
import HomeContainer from './components/tabbar/HomeContainer.vue'
import MemberContainer from './components/tabbar/MemberContainer.vue'
import ShopcarContainer from './components/tabbar/ShopcarContainer.vue'
import SearchContainer from './components/tabbar/SearchContainer.vue'
import NewsList from './components/news/NewsList.vue'
import NewsInfo from './components/news/NewsInfo.vue'
import PhotoList from './components/photos/PhotoList.vue'

var router = new VueRouter({
    routes: [   //配置路由规则
        { path: '/' ,redirect: '/home' },
        { path: '/home' ,component: HomeContainer  },
        { path: '/member' ,component: MemberContainer  },
        { path: '/shopcar' ,component: ShopcarContainer  },
        { path: '/search' ,component: SearchContainer  },
        { path: '/home/newslist' ,component: NewsList ,name: "newslist" },
        { path: '/home/newsinfo/:id' ,component: NewsInfo },
        { path: '/home/photolist' ,component: PhotoList  },
    ],
    linkActiveClass: 'mui-active' ,   //覆盖Vue默认的路由高亮类“router-link-active”

    //mode: 'history'  //把Router的mode修改为history模式,VueRouter默认的模式为HASH模式.(HASH模式的表现形式有：在开发的过程中会发现，访问VUE的项目是会在访问地址后面加上#，这个#其实是VUE的HASH模式所产生的，正确点来说是因为VUE使用了HASH模式。)
})

export default router